<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Stock List</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
            margin: 0;
            padding: 0;
        }

        h1 {
            text-align: center;
            background-color: #333;
            color: #fff;
            padding: 10px;
        }
        table {
            width: 80%;
            margin: 20px auto;
            border-collapse: collapse; 
        } 

        th, td {
            border: 1px solid #ddd;
            padding: 8px;
            text-align: left;   
        }
        
    </style>
</head>
<body>
<h1>Stock List</h1>
<table border="1">
  <tr>
    <th>TS Code</th>
    <th>Symbol</th>
    <th>Name</th>
    <th>Area</th>
    <th>Industry</th>
    <th>List Date</th>
  </tr>
  {% for stock in stocks %}
  <tr>
    <td><a href="{% url 'stocks:stock_detail' stock.ts_code %}">{{ stock.ts_code }}</a></td>
    <td>{{ stock.symbol }}</td>
    <td>{{ stock.name }}</td>
    <td>{{ stock.area }}</td>
    <td>{{ stock.industry }}</td>
    <td>{{ stock.list_date }}</td>
  </tr>
  {% endfor %}
</table>
</body>
</html>